package com.hex.ds.hdtp.core.inf.common.page.converter;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hex.ds.hdtp.core.inf.common.page.Page;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * @Package: com.hex.hdc.center.inf.common.page.converter
 * @ClassName PageDoAndPageConverter
 * @Description: Page And baomi Page 转换器
 * @Author: Dong shiyi
 * @Date 2022/3/10 11:16
 * @Version v1.0
 **/
@Mapper(componentModel = "spring")
public interface IPageAndMyBatisPlusPageConverter {

    @Mapping(source = "current", target = "pageIndex")
    @Mapping(source = "size", target = "pageSize")
    @Mapping(source = "records", target = "data")
    Page toPage(IPage po);

    @Mapping(source = "pageIndex", target = "current")
    @Mapping(source = "pageSize", target = "size")
    com.baomidou.mybatisplus.extension.plugins.pagination.Page toMyBatisPlusPage(Page dto);

}

